// 工具方法集合
import * as utils from './utils.js' // 工具
import * as check from './check.js' // check

import * as date from './date.js' // 时间

const all = {
  check,
  ...date,
  ...utils
}

export default (Vue) => {
  console.log('=====================')
  Object.keys(all).forEach((name) => {
    if (uni.canIUse(`$${name}`)) {
      console.warn(
        `utils/${name}已经被uni-app占用，将不会被挂载到Vue.prototype上`
      )
    } else {
      uni[`$${name}`] = all[name]
      Vue.prototype[`$${name}`] = all[name]
    }
  })
}
